<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<s:url value="/css/style.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<s:url value="/js/jquery.js"/>" ></script>
<script type="text/javascript" src="<s:url value="/js/common.js"/>" ></script>
<script type='text/javascript' src="<s:url value="/js/tableSel2.js"/>"></script>
<script type="text/javascript">
function dosubmit(){

	$('#listForm').submit();
}
function goEdit(){
	location.href='<s:url value="/data/Teacher/edit"/>';
}
function goDelete(form){
	if(window.confirm('Delete selected items?')) {
		form = document.getElementById('listForm');
		var ids = getSelectionIds('a');
		if(ids.length<1){
			alert('Please select one at least.');
		}else{
			form.action=form.action.replace('list','delete');
			$('#ids').val(ids);
			form.submit();
		}
	}
}
</script>
<title><s:text name="system.title" /></title>
</head>
<body>
<s:include value="/common/up.jsp"></s:include>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="box">
    <s:form action="Teacher/list" name="listForm" id="listForm" namespace="/data">
    <input type="hidden" id="startIndex" name="startIndex" value="0" />
    <s:hidden name="ids" id="ids" />
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="searchbg">
      <tr>
        <td>
		  &nbsp;Name:<s:textfield name="name" cssClass="input2" size="15" />
          <img src="<s:url value="/img/right/btns.gif"/>" border="0" align="absmiddle" onclick="javascript:dosubmit();" /> &nbsp;<img onclick="javascript:goEdit();" src="<s:url value="/img/right/btn1.gif"/>" border="0" align="absmiddle" />
			<img onclick="goDelete(this.form);" src="<s:url value="/img/right/btn2.gif"/>" border="0" align="absmiddle" /> 
        </tr>
      </table>

      <table width="100%" border="0" cellpadding="0" cellspacing="1" class="box2 activeTable" >
        <tr>
          <td width="33" class="tablecolour1"><input type="checkbox" name="all" onclick="checkAll('a',this)" /></td>
          <td class="tablecolour1">Name</td>
           <td class="tablecolour1">Telephone</td>
          <td class="tablecolour1">Address</td>
          <td class="tablecolour1">Nationality</td>
          <td class="tablecolour1">Gender</td>
          <td class="tablecolour1">Start Date</td>
          <td class="tablecolour1">End Date</td>
          <td class="tablecolour1">Function</td>
        </tr>
        <s:iterator value="listResult.items" status="status">
        	<tr>
        		 <td class="tablecolour2"><input type="checkbox" name="a" value="<s:property value="id" />" /></td>
        		  <td class="tablecolour2"><s:property value="name" /></td>
        		  <td class="tablecolour2"><s:property value="telephone" /></td>
        		  <td class="tablecolour2"><s:property value="address" /></td>
        		  <td class="tablecolour2"><s:property value="nationality" /></td>
        		  <td class="tablecolour2"><s:property value="gender" /></td>
        		  <td class="tablecolour2"><s:date name="startDate" format="yyyy-MM-dd" /></td>
        		  <td class="tablecolour2"><s:date name="endDate" format="yyyy-MM-dd" /></td>
        		  <td class="tablecolour2"><a href='<s:url value="/data/Teacher/edit?id="/><s:property value="id"/>'>Edit</a></td>
        	</tr>
        </s:iterator>
      </table>
      <s:include value="/common/page.jsp"></s:include>
      </s:form>
    </td>
  </tr>
</table>
<s:include value="/common/down.jsp"></s:include>
</body>
</html>